﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace HengTong.DataAccess.Migrations
{
    /// <inheritdoc />
    public partial class 招聘需求明细子表关联错误修改 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {

            migrationBuilder.DropForeignKey(
                name: "FK_SysHrRecruitRequestBillEntry_SysHrRecruitRequestBill_RecruitRequestBillID",
                table: "SysHrRecruitRequestBillEntry");

            migrationBuilder.DropColumn(
                name: "RecruitId",
                table: "SysHrRecruitRequestBillEntry");

            migrationBuilder.RenameColumn(
                name: "RecruitRequestBillID",
                table: "SysHrRecruitRequestBillEntry",
                newName: "RecruitRequestBillId");

            migrationBuilder.RenameIndex(
                name: "IX_SysHrRecruitRequestBillEntry_RecruitRequestBillID",
                table: "SysHrRecruitRequestBillEntry",
                newName: "IX_SysHrRecruitRequestBillEntry_RecruitRequestBillId");
            

            migrationBuilder.AddForeignKey(
                name: "FK_SysHrRecruitRequestBillEntry_SysHrRecruitRequestBill_RecruitRequestBillId",
                table: "SysHrRecruitRequestBillEntry",
                column: "RecruitRequestBillId",
                principalTable: "SysHrRecruitRequestBill",
                principalColumn: "ID");
            
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {

            migrationBuilder.DropForeignKey(
                name: "FK_SysHrRecruitRequestBillEntry_SysHrRecruitRequestBill_RecruitRequestBillId",
                table: "SysHrRecruitRequestBillEntry");

            migrationBuilder.RenameColumn(
                name: "RecruitRequestBillId",
                table: "SysHrRecruitRequestBillEntry",
                newName: "RecruitRequestBillID");

            migrationBuilder.RenameIndex(
                name: "IX_SysHrRecruitRequestBillEntry_RecruitRequestBillId",
                table: "SysHrRecruitRequestBillEntry",
                newName: "IX_SysHrRecruitRequestBillEntry_RecruitRequestBillID");
            

            migrationBuilder.AddColumn<Guid>(
                name: "RecruitId",
                table: "SysHrRecruitRequestBillEntry",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.AddForeignKey(
                name: "FK_SysHrRecruitRequestBillEntry_SysHrRecruitRequestBill_RecruitRequestBillID",
                table: "SysHrRecruitRequestBillEntry",
                column: "RecruitRequestBillID",
                principalTable: "SysHrRecruitRequestBill",
                principalColumn: "ID");

            
        }
    }
}
